import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/vue-admin-template/table/list',
    method: 'get',
    params
  })
}
export const getExpenditureList = (text) => {
  var newUrl = `/order?`
  if (text.shop) {
    newUrl += `shop_name_like=${text.shop}`
  }
  if (text.usname) {
    newUrl += `&user_name=${text.usname}`
  }
  if (text.type) {
    newUrl += `&delivery_meth=${text.type}`
  }

  if (text.order_number) {
    newUrl += `&id=${text.order_number}`
  }
  return request({
    url: newUrl,
    method: 'get'
  })
}

export function date(page) {
  return request({
    url: `/order?_page=${page.page}&_limit=${page.size}`

  })
}

export function paging(page) {
  return request({
    url: `/shop?_page=${page.page}&_limit=${page.size}`
  })
}

export function shenhe(data) {
  return request({
    url: `/shop/${data.id}`,
    method: 'patch',
    data
  })
}
